InputPanel for WinForms | ComponentOne
C1.Win.4.8 Assembly / C1.Win.Drawing Namespace / StringRendererGDIPlus Class / HighlightSubstring Method / HighlightSubstring(Graphics,Font,StringFormat,Brush,Rectangle,String,Brush,IList<CharacterRange>) Method
The device context in which to draw the text.
The System.Drawing.Font to apply to the drawn text.
The text layout information.
The System.Drawing.Brush to apply to the drawn text.
The System.Drawing.Rectangle that represents the bounds of the text.
The text to draw.
The highlight System.Drawing.Brush of substrings.
Positions and lengths of all occurrences of substrings to highlight.

In This Topic
    HighlightSubstring(Graphics,Font,StringFormat,Brush,Rectangle,String,Brush,IList<CharacterRange>) Method
    In This Topic
    Draws text and highlight a parts of that text with a special background.
    Syntax
    'Declaration
     
    Public Overloads Shared Sub HighlightSubstring( _
       ByVal graphics As Graphics, _
       ByVal font As Font, _
       ByVal stringFormat As StringFormat, _
       ByVal foreBrush As Brush, _
       ByVal bounds As Rectangle, _
       ByVal text As String, _
       ByVal highlightBrush As Brush, _
       ByVal substringRanges As IList(Of CharacterRange) _
    ) 
    public static void HighlightSubstring( 
       Graphics graphics,
       Font font,
       StringFormat stringFormat,
       Brush foreBrush,
       Rectangle bounds,
       string text,
       Brush highlightBrush,
       IList<CharacterRange> substringRanges
    )

    Parameters

    graphics
    The device context in which to draw the text.
    font
    The System.Drawing.Font to apply to the drawn text.
    stringFormat
    The text layout information.
    foreBrush
    The System.Drawing.Brush to apply to the drawn text.
    bounds
    The System.Drawing.Rectangle that represents the bounds of the text.
    text
    The text to draw.
    highlightBrush
    The highlight System.Drawing.Brush of substrings.
    substringRanges
    Positions and lengths of all occurrences of substrings to highlight.
    See Also